package com.ygo.feihua;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import cn.bmob.v3.BmobUser;
import com.ygo.feihua.BmobTable.MyUser;
import com.ygo.feihua.Management.LiaotianManagement;
import com.ygo.feihua.Management.LiaotianView;
import android.widget.*;
import com.ygo.feihua.Management.*;

public class LiaotianQunliao extends AppCompatActivity {
	
	
	
	private UserManagement um;

	
	Gongju gj;
	//聊天控件类
	LiaotianView lv;
	//聊天管理类
	LiaotianManagement ltm;
	private LinearLayout ql_layout;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.chat_layout);
		gj=Gongju.getdx(this);
		
		um=UserManagement.getDx();
		Toolbar tool=(Toolbar) findViewById(R.id.toolbar);
		gj.cshToolbar(tool,"群聊");

		tool.setOnMenuItemClickListener(onmenu);
		
		ql_layout=(LinearLayout) findViewById(R.id.ql_layout);
		sx();
	
		
		
	}
	
	void sx(){

		
		//初始化聊天控件
		lv=new LiaotianView(this,ql_layout);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu)
	{
		getMenuInflater().inflate(R.menu.menu_qunliao,menu);
		// TODO: Implement this method
		return super.onCreateOptionsMenu(menu);
		
		
	}
	private Toolbar.OnMenuItemClickListener onmenu=new Toolbar.OnMenuItemClickListener(){

		@Override
		public boolean onMenuItemClick(MenuItem p1)
		{
			switch(p1.getItemId()){
				case R.id.action_robot:
					startActivity(new Intent(LiaotianQunliao.this,RobotFeihua.class));
					break;
				
			}
			
			// TODO: Implement this method
			return true;
		}
	};
	

}
